﻿using System;

namespace Database.Core.Attributes
{
  /// <summary>
  /// Used to map database values to local enum values
  /// </summary>
  [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
  public class EnumValueMap : Attribute
  {
    /// <summary>
    /// Gets string representation of an enum value.
    /// </summary>
    /// <value>Enum value.</value>
    public string EnumValue { get; private set; }

    /// <summary>
    /// Gets the database value.
    /// </summary>
    /// <value>The database value.</value>
    public string DatabaseValue { get; private set; }

    /// <summary>
    /// Initializes a new instance of the <see cref="EnumValueMap"/> class.
    /// </summary>
    /// <param name="enumValue">String representation of the enum value (Enum.Value.ToString()).</param>
    /// <param name="databaseValue">The database value to map.</param>
    public EnumValueMap(string enumValue, string databaseValue)
    {
      EnumValue = enumValue;
      DatabaseValue = databaseValue;
    }
  }
}